Test MCP Authentication
Used to test MCP (Model Context Protocol) server authentication. This endpoint validates that the authentication configuration is working correctly by attempting to connect to the MCP server, discover available tools, and return a success or failure status.
API Endpoint
| Property | Value |
|---|---|
| Request Method | POST |
| Request URL | https://api.seliseblocks.com/tools/{tool_id}/test-mcp-auth |
What This Endpoint Does
The test authentication process performs the following checks:
- Connect to MCP Server: Attempts to establish a connection using the configured authentication
- Discover Available Tools: Queries the server for available tools and resources
- Return Status: Provides detailed success or failure information
This is particularly useful for validating OAuth tokens, bearer tokens, or API keys.
Request
Request Example
curl -X POST 'https://api.seliseblocks.com/tools/{tool_id}/test-mcp-auth?project_key=YOUR_PROJECT_KEY' \
-H 'accept: application/json'
Path Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| tool_id | string | Yes | The unique identifier of the MCP server tool. |
Query Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| project_key | string | No | The project key for your project. |
Request Headers
| Field | Type | Required | Description |
|---|---|---|---|
| accept | string | Yes | Accepted response format. Use application/json |
note
Authentication Test Details
- This endpoint requires no request body
- The test uses the currently configured authentication credentials
- Connection timeout is typically set to 10-30 seconds
- Tool discovery is limited to basic metadata retrieval
- Does not modify any server state or data
tip
When to use this endpoint:
- After configuring or updating OAuth credentials
- After completing OAuth flow to verify tokens work
- When troubleshooting authentication issues
- Before deploying MCP server integration to production
- Periodically to monitor authentication health
- After token refresh to confirm new tokens are valid
The system will:
- Use the stored authentication configuration (OAuth tokens, API keys, etc.)
- Attempt to establish a secure connection to the MCP server
- Make a lightweight request to discover available tools
- Validate response format and authentication success
- Return detailed error information if authentication fails
- Log authentication attempts for security monitoring
Response
Success Response (200 OK)
Returns an object containing the authentication test results.
{
"is_authenticated": true,
"connection_status": "connected",
"tools_discovered": 15,
"server_version": "1.2.0",
"message": "Authentication successful. MCP server is accessible.",
"test_timestamp": "2026-01-12T07:28:51.601Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| is_authenticated | boolean | Indicates whether authentication was successful. |
| connection_status | string | Status of the connection (e.g., "connected", "failed"). |
| tools_discovered | integer | Number of tools discovered on the MCP server. |
| server_version | string | Version of the MCP server (if available). |
| message | string | Human-readable status message. |
| test_timestamp | string | ISO 8601 timestamp when the test was performed. |
Failed Authentication Response
Returns details when authentication fails.
{
"is_authenticated": false,
"connection_status": "authentication_failed",
"error_type": "invalid_token",
"message": "Authentication failed: Access token has expired",
"test_timestamp": "2026-01-12T07:28:51.601Z",
"suggestions": [
"Refresh the OAuth access token",
"Re-authenticate using the OAuth flow",
"Verify token expiration time"
]
}
Failed Authentication Fields
| Field | Type | Description |
|---|---|---|
| is_authenticated | boolean | Always false for failed authentication. |
| connection_status | string | Reason for failure (e.g., "authentication_failed", "connection_timeout"). |
| error_type | string | Specific error type (e.g., "invalid_token", "expired_credentials"). |
| message | string | Detailed error message. |
| test_timestamp | string | ISO 8601 timestamp when the test was performed. |
| suggestions | array | List of suggested actions to resolve the issue. |
Error Response (422 Unprocessable Entity)
Returns validation error details when the request parameters are invalid.
{
"detail": [
{
"loc": [
"path",
"tool_id"
],
"msg": "MCP server tool not found",
"type": "value_error.notfound"
}
]
}
Error Response Fields
| Field | Type | Description |
|---|---|---|
| detail | array | Array of validation error objects. |
| loc | array | Location of the error in the request (e.g., path, query). |
| msg | string | Human-readable error message. |
| type | string | Error type identifier. |
Common Test Results
| Status | Description | Recommended Action |
|---|---|---|
| Success | Authentication working correctly | No action needed |
| Expired Token | OAuth access token has expired | Use refresh token or re-authenticate |
| Invalid Credentials | API key or token is invalid | Update authentication configuration |
| Connection Timeout | Cannot reach MCP server | Check server URL and network connectivity |
| Server Error | MCP server returned an error | Check MCP server logs and status |
Error Codes
| Status Code | Description | Response Type |
|---|---|---|
| 200 | Test Completed - Check response for auth status | Success |
| 400 | Bad Request - Invalid test parameters | Bad Request |
| 404 | Not Found - MCP server tool does not exist | Not Found |
| 422 | Validation Error - Invalid request parameters | Unprocessable Entity |
| 503 | Service Unavailable - Cannot connect to MCP server | Service Unavailable |